package edu.tsp.ga;


public class Gene {

    private int allele;

    public Gene(int allele) {
        this.allele = allele;
    }

    public int getAllele() {
        return allele;
    }

    public Gene clone() {
        return new Gene(this.allele);
    }

    @Override
    public boolean equals(Object obj) {
        if(obj instanceof Gene) {
            Gene that = (Gene)obj;
            return this.allele == that.allele;
        }
        return false;
    }

    @Override
    public int hashCode() {
        return this.allele;
    }

    public String toString() {
        return allele+"";
    }
}
